/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.dew.service;

import java.util.ArrayList;
import java.util.List;
import pe.edu.upc.dew.dao.PaqueteDao;
import pe.edu.upc.dew.dao.PaqueteDaoImpl;
import pe.edu.upc.dew.model.Paquete;

/**
 *
 * @author Juliana
 */
public class PaqueteServiceImpl implements PaqueteService{
    
    PaqueteDao paDAO ;

    @Override
    public int registrarPaquete(Paquete paquete){
        return paDAO.registrarPaquete(paquete);
    }

     @Override
    public List<Paquete> obtenerPaquetes(){

        if(paDAO == null){
            paDAO = new PaqueteDaoImpl();
        }
        List<Paquete> paqs = paDAO.obtenerPaquetes();
        
        
        return paqs;
    }

    public void setPaDAO(PaqueteDao paDAO) {
        this.paDAO = paDAO;
    }

}

